﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using LEARNREN.COM.Entity;

namespace LEARNREN.COM.UI.Template
{
    public class ShowProductTemplate:HtmlTemplate
    {
        Product productEntity = null;

        /// <summary>
        /// 实例化产品显示模板
        /// </summary>
        /// <param name="tmpFile">模板相对路径，以~开头形式的</param>
        /// <param name="pId">产品ID</param>
        public ShowProductTemplate(string tmpFile, long pId)
            : base(tmpFile)
        {
            productEntity = this.groupLogicFactory.ProductLogic.GetById(pId);
        }

        protected override void SetContextData()
        {
            base.SetContextData();
            this.context.State = productEntity;
            this.context.CatalogueID = productEntity.CatalogueId;
        }
    }
}
